/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.games.ddmonsters.servers.gameserver.components;

import digitaldreamers.games.ddmonsters.servers.gameserver.components.basicinfomation.CardInformation;

/**
 * A card that a player owns.
 * @author DaoLe
 */
public class PlayerCardComponent {
    
    // <editor-fold defaultstate="collapsed" desc="Constants">
    
    // <editor-fold defaultstate="collapsed" desc="Database column names">
    public static final String ID_COLUMN = "id";
    // </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="Error messages">
    private static final String CARD_INFORMATION_IS_NULL_ERROR_MESSAGE = "Card information can not be null.";
    private static final String OWNER_IS_NULL_ERROR_MESSAGE = "Owner can not be null.";
    // </editor-fold>
    
     // </editor-fold>
    
    private CardInformation m_CardInformation;
    private int m_iID;
    PlayerComponent m_Owner;
    
    public CardInformation getCardInformation() {
        return m_CardInformation;
    }
    
    public void setCardInformation(CardInformation cardInformation) {
        m_CardInformation = cardInformation;
    }
    
    public int getID() {
        return m_iID;
    }
    
    public void setID(int iID) {
        m_iID = iID;
    }
    
    public PlayerCardComponent(CardInformation cardInformation, int iID, PlayerComponent owner) throws IllegalArgumentException {
        if (cardInformation == null) {
            throw new IllegalArgumentException(CARD_INFORMATION_IS_NULL_ERROR_MESSAGE);
        }
        if(owner == null) {
            throw new IllegalArgumentException(OWNER_IS_NULL_ERROR_MESSAGE);
        }
        m_CardInformation = cardInformation;
        m_iID = iID;
        m_Owner = owner;
    }
}